import React, { Component } from 'react'
import { Link } from 'react-router-dom'

import Loginservice from '../services/login'
const loginservice = new Loginservice()

export default class IndexPage extends Component {
    constructor(props){
        super(props)
        this.state={}
        
    }
    async loginCheck(){
        const result = await loginservice.loginCheck();
        const errorCode = result.error_code;
        if(errorCode === 10006){
            const {history} = this.props;
            history.push('/login')
        }
    }
    render() {
        const {children} = this.props
        return (
            <div>
                <ul>
                    <li>
                        <Link to="/sub/list">列表页</Link>
                    </li>
                    <li>
                        <Link to="/sub/detail">详情页</Link>
                    </li>
                </ul>
                {children}
            </div>
        )
    }
}
